Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix coach, cable tram and trolleybus GTFS route types #6086

Closed
wants to merge 9 commits into from

Conversation

miklcct
Copy link
Contributor

@miklcct miklcct commented Sep 23, 2024

Summary

Fix GTFS extended route types for coach (2xx) and trolleybus (8xx). Also change the references of "cable car" in the American sense to "cable tram" according to the reference as "cable car" has a completely separate meaning (aerial lift) in Europe.

Issue

Fixes #5550

Unit tests

added for more existing modes

Documentation

fixed for cable tram

@miklcct miklcct requested a review from a team as a code owner September 23, 2024 14:13
Copy link

codecov bot commented Sep 23, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 5 lines in your changes missing coverage. Please review.

Project coverage is 69.86%. Comparing base (c93fc7c) to head (ee281bc).

Files with missing lines Patch % Lines
...ipplanner/ext/restapi/mapping/RouteTypeMapper.java 0.00% 2 Missing ⚠️
...pentripplanner/gtfs/mapping/TransitModeMapper.java 87.50% 0 Missing and 2 partials ⚠️
...tripplanner/netex/mapping/StopPlaceTypeMapper.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #6086      +/-   ##
=============================================
+ Coverage      69.81%   69.86%   +0.04%     
- Complexity     17418    17437      +19     
=============================================
  Files           1974     1974              
  Lines          74545    74547       +2     
  Branches        7633     7633              
=============================================
+ Hits           52047    52080      +33     
+ Misses         19848    19828      -20     
+ Partials        2650     2639      -11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@leonardehrenfried leonardehrenfried added the GTFS Related to import of GTFS data label Sep 24, 2024
Copy link
Member

@leonardehrenfried leonardehrenfried left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to OTP's complexity, I'm afraid there is no such thing as a trivial change anymore and we expect you to write a test for every PR. Luckily, testing this this is quite easy and you can add more test cases to the existing ones.

On top of this, using COACH instead BUS may be the correct thing to do for the 200-299 type range but it is a breaking change so we will need to check with the relevant users.

@miklcct miklcct changed the title Fix coach and trolleybus extended GTFS route types Fix coach, cable tram and trolleybus GTFS route types Sep 25, 2024
@miklcct
Copy link
Contributor Author

miklcct commented Sep 25, 2024

Added change for cable tram as well. GTFS route type 5 was originally called "cable car", but it was a misleading term because a "cable car" means "aerial lift" in Europe, so the specification has now changed to "cable tram".

I have changed all references to it in the UI, and also fixed the Transmodel mapping mistake resulted from the misleading term.

Copy link
Contributor Author

@miklcct miklcct left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment moved to separate lines

@t2gran t2gran added this to the 2.7 (next release) milestone Oct 16, 2024
@t2gran
Copy link
Member

t2gran commented Oct 16, 2024

I am sorry, but I am not in favour of merging this PR, it is possible that we can merge piece of it as separate PRs.

  • We have stoped maintaining the old client unless it is a critical fix - we are deleting this code when the new debug client is a good enough alternative for debugging transit (it is already in good shape for debugging street routing).
  • There are two fixes to GTFS mapping and Transmodel in this PR - these changes need to be split into separate PRs. We also need issues for each of these analyzing the consequences and giving people time to fix their data. There are also different strategies for how to do these changes - some without breaking backwards compatibility.

@miklcct
Copy link
Contributor Author

miklcct commented Oct 16, 2024

Sorry what do you mean? For CABLE_CAR, we need to correct the documentation and also the Transmodel mapping because the Transmodel mistake is a direct result of interpreting American English as British English. Should I put these changes into one PR or separate PRs?

For bus / coach, do you think that having a feature flag (I propose to name it as GtfsCoach) will be a good idea?

@t2gran
Copy link
Member

t2gran commented Oct 17, 2024

Sorry what do you mean? For CABLE_CAR, we need to correct the documentation and also the Transmodel mapping
because the Transmodel mistake is a direct result of interpreting American English as British English. Should I put these
changes into one PR or separate PRs?

No one disagree that it was a mistake, but the mistake is adopted in many clients. So, if someone is selling tickets in one of these clients they might filter on CABLE_CAR - even if it is wrong. So to allow them to migrate we need to analyze if it is a problem first, then find a strategy for migration. This is the "real" task of fixing known problems like this one.

@miklcct miklcct marked this pull request as draft October 17, 2024 10:49
@miklcct
Copy link
Contributor Author

miklcct commented Oct 17, 2024

I am going to rework on this and release my proposed changes into a few different packages for each mode of transport.

@miklcct
Copy link
Contributor Author

miklcct commented Oct 17, 2024

Superceded by #6170, #6171, #6173 and #6174 with the exception of the legacy REST API.

@miklcct miklcct closed this Oct 17, 2024
@miklcct miklcct deleted the coach_gtfs branch October 17, 2024 13:57
@t2gran t2gran modified the milestones: 2.7 (next release), Rejected Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GTFS Related to import of GTFS data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenTripPlanner returns a route as mode "BUS" instead of "COACH" for GTFS route type 200
3 participants